Skip to content

MODEUR-175 Avoid multiplication of usage counts#200

Merged
nielserik merged 1 commit intomasterfrom
MODEUR-175
Mar 18, 2026
Merged

MODEUR-175 Avoid multiplication of usage counts#200
nielserik merged 1 commit intomasterfrom
MODEUR-175

Conversation

@nielserik
Copy link
Contributor

... when there are multiple invoices for a subscription.

Changes:

  • add aggregated view of costs per agreement line and join usage data with that instead of with agreement_entries; to avoid that usage counts are multiplied by the number of invoices
  • fix the unit test sample data setup that would set the same cost on every agreement line for an agreement id, as opposed to the application itself that will instead insert a new unique agreement line for every invoice/cost into agreement_entries
  • use this to change the sample data to apply multiple invoices with different costs for a line, in order to properly test that request counts and costs are properly summed up and divided for cost per request

... when there are multiple invoices for a subscription.

Changes:
- add aggregated view of costs per agreement line and join usage data with that instead of with agreement_entries; to avoid that usage counts are multiplied by the number of invoices
- fix the unit test sample data setup that would set the same cost on every agreement line for an agreement id, as opposed to the application itself that will instead insert a new unique agreement line for every invoice/cost into agreement_entries
- use this to change the sample data to apply multiple invoices with different costs for a line, in order to properly test that request counts and costs are properly summed up and divided for cost per request
@sonarqubecloud
Copy link

@nielserik nielserik requested a review from adamdickmeiss March 18, 2026 13:18
return;
}
UUID poLineId = UUID.fromString(query.substring(10));
UUID poLineId = UUID.fromString(query.substring(10,46));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, for https://folio-org.atlassian.net/browse/MODEUR-176 actually, query will get an additional parameter. PR coming soon.

@nielserik nielserik merged commit a701cca into master Mar 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants